package com.cdut.hezhisu.dribbble;

import android.app.Application;
import android.content.Context;
import android.os.Environment;

import com.facebook.cache.disk.DiskCacheConfig;
import com.facebook.drawee.backends.pipeline.Fresco;

import java.io.File;

/**
 * Created by Administrator on 2015/12/23 0023.
 */
public class DribbbleApp extends Application{
    public static Context mAppContext = null;
    public static final String BASIC_IMAGE_PATH = android.os.Environment.getExternalStorageDirectory() + File.separator +  "dribbble";

    @Override
    public void onCreate() {
        super.onCreate();
        mAppContext = this.getApplicationContext();
        initImageLoader(this.getApplicationContext());
        createImageDir();
    }


    /*
	 * 初始化图片缓存；
	 */
    public static void initImageLoader(Context context) {

        Fresco.initialize(context);

    }

    public static void createImageDir(){
        File destDir = new File(BASIC_IMAGE_PATH);
        if (!destDir.exists()) {
            destDir.mkdirs();
        }
    }
}
